`
https://leetcode.cn/problems/evaluate-reverse-polish-notation/
`

/**
 * @param {string[]} tokens
 * @return {number}
 */
var evalRPN = function (tokens) {
  const stk = []
  for (const c of tokens) {
    if ("+-*/".includes(c)) {
      // 是运算符，从栈里取出两个值进行运算
      const a = stk.pop()
      const b = stk.pop()
      switch (c) {
        case '+':
          stk.push(b + a);
          break;
        case '-':
          stk.push(b - a);
          break;
        case '*':
          stk.push(b * a);
          break;
        case '/':
          stk.push(Math.trunc(b / a));
          break;
      }
    } else {
      // 是个数字，放入栈
      stk.push(+c)
    }
  }
  return stk.pop()
};